<template>
    <div id="header">
      <img class="header-logo" src="@/assets/logo.png">
      <h1 class="header-title">后台管理系统</h1>
      <div class="portrait" >
        <el-popover
          :visible-arrow=false
          placement="bottom"
          trigger="click"
        >
          <div class="card-box">
            <p class="message-number">您有4条新消息</p>
            <div class="info-box clearfix">
              <div class="fl person">
                <img src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
              </div>
              <div class="fr info">
                <p class="desc">天行健以自强不息，地势坤以厚德载物。天行健以自强不息，地势坤以厚德载物。</p>
                <div class="record">
                  <span>MR.Tang</span>
                  <i class="time">5小时前</i>
                </div>
              </div>
            </div>
            <div class="info-box clearfix">
              <div class="fl person">
                <img src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
              </div>
              <div class="fr info">
                <p class="desc">天行健以自强不息，地势坤以厚德载物。天行健以自强不息，地势坤以厚德载物。</p>
                <div class="record">
                  <span>MR.Tang</span>
                  <i class="time">5小时前</i>
                </div>
              </div>
            </div>
            <div class="info-box clearfix">
              <div class="fl person">
                <img src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
              </div>
              <div class="fr info">
                <p class="desc">天行健以自强不息，地势坤以厚德载物。天行健以自强不息，地势坤以厚德载物。</p>
                <div class="record">
                  <span>MR.Tang</span>
                  <i class="time">5小时前</i>
                </div>
              </div>
            </div>
            <p class="message-more">查看更多</p>
          </div>
          <el-badge is-dot slot="reference">
            <i class="el-icon-bell"></i>
          </el-badge>
        </el-popover>
        <el-badge is-dot>
        <i class="el-icon-message"></i>
        </el-badge>
        <div class="line">|</div>
        <span class="user-name">Sven Tang</span>
        <el-dropdown>
        <el-avatar class="avatar" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item icon="el-icon-user-solid">个人中心</el-dropdown-item>
            <el-dropdown-item icon="el-icon-message">我的消息</el-dropdown-item>
            <el-dropdown-item icon="el-icon-s-tools">系统设置</el-dropdown-item>
            <el-dropdown-item style="color:red" icon="el-icon-switch-button" :divided="true">退出登陆</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
</template>

<script>
export default {
  name: 'Header'
}
</script>

<style scoped>
#header{
  text-align: left;
  position: relative;
}
.header-title{
  display: inline-block;
  color: #fff;
  line-height: 80px;
  height: 80px;
  margin-left: 60px;
  font-size: 36px;
}
.header-logo{
  width: 40px;
  height: 40px;
  display: block;
  position: absolute;
  left: 0;
  top:50%;
  margin-top: -20px;
}
.portrait{
  position: absolute;
  right:0;
  top:0;
  bottom: 0;
  margin: auto;
}
.portrait i{
  font-size: 20px;
  color: #C0C4CC;
  /*margin-right: 20px;*/
  margin-left: 20px;
}
.portrait i:hover{
  color: #fff;
}
.line{
  margin-left: 20px;
  color:#909399;
  display: inline-block;
}
.user-name {
  font-size: 18px;
  color: #fff;
  line-height: 80px;
  padding-left: 20px;
  margin-right: 20px;
}
.avatar{
  vertical-align: middle;
}
.message-number{
  text-align: center;
  height: 52px;
  line-height: 52px;
  background-color: #26b4ff;
  font-size: 14px;
  color: #ffffff;
}
.info-box{
  height: 50px;
  padding: 10px 15px;
  border-bottom: 1px solid #f1f1f2;
}
.person{
  width: 40px;
  height: 40px;
  margin-right: 5px;
}
.person img{
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.info{
  width: 265px;
  overflow:hidden;text-overflow:ellipsis;
}
.info .desc{
    font-size: 12px;
    margin-bottom: 3px;
  }
.info .record{
    font-size: 12px;
    color: #babbbc;
  }
.info .time{
    margin-left: 10px;
  }
.message-more{
    height: 33px;
    line-height: 33px;
    font-size: 12px;
    color: #8c8e90;
    text-align: center;
  }
</style>
